cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(HashEncoder LANGUAGES CXX CUDA)

set(CMAKE_PREFIX_PATH E:/Tools/libtorch)
find_package(CUDA REQUIRED)
find_package(Torch REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" "${TORCH_CXX_FLAGS}")

set(SRCS hashencoder.cu  hashencoder.h)
add_library(HashEncoder SHARED ${SRCS})
set_property(TARGET HashEncoder PROPERTY CXX_STANDARD 17)
target_link_libraries(HashEncoder "${TORCH_LIBRARIES}")

add_executable(Tasts cudaTest.cpp hashencoder.cu  hashencoder.h)
set_property(TARGET Tasts PROPERTY CXX_STANDARD 17)
target_link_libraries(Tasts "${TORCH_LIBRARIES}")